package com.jvyou.app.ds.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jvyou.app.common.constants.BaseConstants;
import com.jvyou.app.ds.domain.entity.Carousel;
import com.jvyou.app.ds.mapper.CarouselMapper;
import com.jvyou.app.ds.service.CarouselService;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 轮播图数据表(Carousel)表服务实现类
 *
 * @author 橘柚
 * @since 2025-04-02 08:09:59
 */
@Service("carouselService")
public class CarouselServiceImpl extends ServiceImpl<CarouselMapper, Carousel> implements CarouselService {

    @Override
    public List<Carousel> all() {
        LambdaQueryWrapper<Carousel> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByDesc(Carousel::getSortOrder);
        wrapper.eq(Carousel::getStatus, BaseConstants.NORMAL);
        return list(wrapper);
    }
}
